<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <nav>
    <RouterLink to="/">首页</RouterLink>

    <!-- <RouterLink to="/news">新闻</RouterLink> -->
    <!-- <RouterLink :to="{path:'/news'}">新闻</RouterLink> -->
    <RouterLink :to="{name:'n'}">新闻</RouterLink>
    
    <RouterLink to="/about">关于</RouterLink>
    <RouterLink to="/join">加入</RouterLink>
    <RouterLink to="/case">案例</RouterLink>
  </nav>
  
  <RouterView />
  <RouterView name="qwe" />
</template>

<style scoped>
nav {
  width: 100%;
  font-size: 20px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: red;
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}
</style>
